package com.gtja.beoms.base;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

import javax.annotation.PostConstruct;


@Component
public class ApiUrlConstants {


    private static String apiUrl;

    private static String kafkaUrl;

    @Value("${api_url}")
    public void setApiUrl(String apiUrl) {
        this.apiUrl = apiUrl;
    }

    @Value("${kafka_url}")
    public void setKafkaUrl(String kafkaUrl) {
        ApiUrlConstants.kafkaUrl = kafkaUrl;
    }

    //读取成员详情
    public String GET_USERDETAIL_URL;

    //获取accesstoken
    public String GET_ACCESSTOKEN_URL;

    //获取userId
    public String GET_USERID_URL;


    public String GET_CUSTOMER_CONFIG_USER_LIST;

    //获取企业微信用户信息
    public String GET_USER_INFO;

    //获取客户列表
    public String EXTERNAL_LIST_URL;

    //批量获取客户详情
    public String EXTERNAL_DETAIL_URL;

    // 获取客户详情
    public String CUSTOM_INFO;

    // 客户与我联系
    public String CUSTOMERCONTACTME_URL;

    // 设置应用
    public String SET_AGENT_URL;

    // 获取应用列表
    public String GET_AGENT_LIST;

    // 获取应用详情
    public String GET_AGENT_INFO;

    // 上传素材
    public String UPLOAD_FILE;

    // 获取客户群列表
    public String CUSTOM_GROUP_LIST_URL;

    // 获取客户群详情
    public String CUSTOM_GROUP_INFO_URL;

    // 获取成员信息
    public String GET_USER_BY_DEPARTMENT;

    //构建企业微信扫码授权链接
    public String QR_CONNECT_URL = "https://open.work.weixin.qq.com/wwopen/sso/qrConnect?";

    //企业微信网页授权链接
    public String WEB_CONNECT_URL = "https://open.weixin.qq.com/connect/oauth2/authorize?";

    //创建企业消息群发接口
    public String CUSTOM_GROUP_MSG_SEND_URL = "https://qyapi.weixin.qq.com/cgi-bin/externalcontact/add_msg_template?";

    /** 生产会话存档整合消息到kafka */
    public String PRODUCT_TIME_NODE_URL;

    /** 获得离职成员的客户名单 */
    public String GET_UNSIGNED_LIST;

    @PostConstruct
    public void init() {
        GET_USERDETAIL_URL = apiUrl + "/getUserDetail?";
        GET_ACCESSTOKEN_URL = apiUrl + "/getAccesstoken?";
        GET_USERID_URL = apiUrl + "/getUserId?";
        GET_CUSTOMER_CONFIG_USER_LIST = apiUrl + "/isCustomerContactConfiguredList?";
        GET_USER_INFO = apiUrl + "/getUserDetail?";
        EXTERNAL_LIST_URL = apiUrl + "/getCustomList?";
        EXTERNAL_DETAIL_URL = apiUrl + "/getBatchCustomDetails?";
        CUSTOM_INFO = apiUrl + "/getCustomDetail?";
        CUSTOMERCONTACTME_URL = apiUrl + "/customContactme?";
        SET_AGENT_URL = apiUrl + "/setAgent";
        UPLOAD_FILE = apiUrl + "/fileUpload";
        CUSTOM_GROUP_LIST_URL = apiUrl + "/getGroupChatList?";
        CUSTOM_GROUP_INFO_URL = apiUrl + "/getGroupChatInfo?";
        GET_USER_BY_DEPARTMENT = apiUrl + "/getUserInfoByDepartment?";
        PRODUCT_TIME_NODE_URL = kafkaUrl + "/writeNode2Wechat";
        GET_UNSIGNED_LIST = apiUrl + "/getUnsignedList?";
    }


}
